<?php

/**
 * backoffice actions.
 *
 * @package    faceshop
 * @subpackage backoffice
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ajaxAction extends sfAction
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function execute($request)
  {	
	$getChildrenCategories = $request->getParameter("getChildrenCategories");
	$id_category_parent = $request->getParameter("id_category_parent");
	$selectedCat = $request->getParameter("selectedCat");
	
	if ($getChildrenCategories) {	
		if ($id_category_parent)
		{
			$children_categories = Catalog::getChildrenWithNbSelectedSubCat($id_category_parent, $selectedCat);
			return $this->renderText(json_encode($children_categories));
		}
	}
	
	
	
    return sfView::SUCCESS;
  }
}
